# Maintainer: Masanori Shirayama <mashir43@gmail.com>

pkgname=fish
pkgver=2.1.2
pkgrel=1
epoch=
pkgdesc="a smart and user-friendly command line shell"
arch=('i686' 'x86_64')
url="http://fishshell.com/"
license=('GPL')
groups=()
depends=('gcc-libs' 'ncurses' 'gettext' 'libiconv' 'doxygen')
makedepends=('gcc' 'ncurses-devel' 'gettext-devel' 'intltool' 'libiconv-devel')
install=fish.install
source=("http://fishshell.com/files/$pkgver/$pkgname-$pkgver.tar.gz"
        01-msysize.patch)
sha1sums=('f7f8d8d26721833be3458b8113c74b747296ec0b'
          '278f82af52f72128ad4a49fcc51fa85b9a778987')

prepare() {
  cd "${srcdir}/$pkgname-$pkgver"
  patch -p1 -i ${srcdir}/01-msysize.patch
  autoreconf -ivf
}

build() {
  cd "${srcdir}/$pkgname-$pkgver"
  CFLAGS+=" $(pkg-config ncursesw --cflags)"
  CXXFLAGS+=" $(pkg-config ncursesw --cflags)"
  CPPFLAGS+=" $(pkg-config ncursesw --cflags)"
  LDFLAGS+=" $(pkg-config ncursesw --libs)"
  ./configure --prefix=/usr --with-doxygen
  make
}

package() {
  cd "${srcdir}/$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
}
